import request from "@/utils/request";

// 新增
export function save(data) {
  return request({
    url: "/manage/project/save",
    method: "post",
    data
  })
}
// 查询
export function getAll(params) {
  return request({
    url: "/manage/project/getAll",
    method: "get",
    params
  })
}
// 删除
export function deleteList(ids) {
  return request({
    url: `/manage/project/delete/${ids}`,
    method: "post"
  })
}
// 详情
export function getById(id) {
  return request({
    url: `/manage/project/getById/${id}`,
    method: "get"
  })
}
// 修改
export function update(data) {
  return request({
    url: "/manage/project/update",
    method: "post",
    data
  })
}
// 获取项目编码
export function getNumber() {
  return request({
    url: `/manage/project/getNumber`,
    method: "get"
  })
}
// 根据id获取行政代码
export function getDivisionCode(divisionId) {
  return request({
    url: '/fxfz/sArea/getDivisionCodeById?divisionId=' + divisionId,
    method: 'get'
  })
}
// 获取项目代码
export function getCode(params) {
  return request({
    url: `/manage/project/getCode`,
    method: "get",
    params
  })
}
// 项目、专题树结构
export function getTreeList() {
  return request({
    url: `/manage/project/getList`,
    method: "get"
  })
}
// 项目结束
export function endProject(ids) {
  return request({
    url: `/manage/project/endProject/${ids}`,
    method: "post"
  })
}
// 当前登录人是否有修改权限
export function changePermission(id) {
  return request({
    url: `/manage/project/changePermission/${id}`,
    method: "post"
  })
}